package cn.edu.model;

/**
 * @author 文欣雨
 * @version V1.0
 * @Package cn.edu.model
 * @date 2023/2/6 19:13
 * 出版物类
 */
public class Publication {
    /**
     * 名称
     */
    private String name;
    /**
     * 作者名
     */
    private String authorName;
    /**
     * 价格
     */
    private Double price;

    /**
     * show()方法
     */
    public void show() {
        System.out.println("出版物: [" +
                "名称: '" + name + '\'' +
                ", 作者名称: '" + authorName + '\'' +
                ", 价格: " + price +
                ']');
    }

    /**
     * 无参构造
     */
    public Publication() {
    }

    /**
     * 有参构造
     *
     * @param name       名称
     * @param authorName 作者名称
     * @param price      价格
     */
    public Publication(String name, String authorName, Double price) {
        this.name = name;
        this.authorName = authorName;
        this.price = price;
    }

    /**
     * setter&getter
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

}
